#include "CTimer.h"

CTimer::CTimer()
{
	QueryPerformanceFrequency(&m_Frequency);
	QueryPerformanceCounter(&m_Counter);
	m_fTimerSpeed = 1;
}

CTimer *CTimer::GetInstance()
{
	static CTimer instance;
	return &instance;
}

void CTimer::Tick()
{
	LARGE_INTEGER Current;
	QueryPerformanceCounter(&Current);

	m_fCurrentElapsed = (Current.QuadPart - m_Counter.QuadPart) / (float)m_Frequency.QuadPart;
	QueryPerformanceCounter(&m_Counter);
}